class <%= class_name %>Image < <%= class_name %>Asset
 
  image_column :file, 
               :versions => {:thumb => "75x75", :small => "300x400"},
               :store_dir => proc{|<%= file_name %>_asset| "<%= file_name %>_assets/#{file_asset.id}/"},
               :tmp_dir => proc{|<%= file_name %>_asset| "<%= file_name %>_assets/tmp/"}
               
  before_save :get_image_dimensions
  
 private
  # NOTE: this will only work bc already using RMagick. Should be part of upload column
  def get_image_dimensions
    img = ::Magick::Image.read(self.file.path).first
    self.file_width = img.columns
    self.file_height = img.rows
  end
end
